package com.store.controller;


import com.store.configure.Result;
import com.store.entity.Message;
import com.store.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 
 * @since 2025-01-06
 */
@RestController
@RequestMapping("/message")
public class MessageController {

    @Autowired
    MessageService messageService;

    /**
     * 添加/修改
     */
    @RequestMapping("/updateMessage")
    public Result<Message> updateMessage(@RequestBody Message message) {
        return messageService.updateMessage(message);
    }

    /**
     * 删除
     */
    @RequestMapping("/delMessage")
    public Result<Message> delMessage(@RequestBody Message message) {
        return messageService.delMessage(message);
    }

    /**
     * 批量删除
     */
    @RequestMapping("/batchDelMessage")
    public Result<Message> batchDelMessage(@RequestBody Message message) {
        return messageService.batchDelMessage(message);
    }

    /**
     * 查询(不分页)
     */
    @RequestMapping("/queryMessage")
    public Result<Message> queryMessage(@RequestBody Message message) {
        return messageService.queryMessage(message);
    }

    /**
     * 查询(分页)
     */
    @RequestMapping("/queryMessageByPage")
    public Result<Message> queryMessageByPage(@RequestBody Message message) {
        return messageService.queryMessageByPage(message);
    }

    /**
     * 根据ID查询
     */
    @RequestMapping("/queryMessageById")
    public Result<Message> queryMessageById(@RequestBody Message message) {
        return messageService.queryMessageById(message);
    }

}

